package ys.ewp.dto;

import java.util.Date;

import ys.ewp.po.Column;

public class ColumnDto {
	
	//栏目ID
	private Integer id;
	//栏目标题
	private String title;
	//栏目描述
	private String description;
	//创建时间
	private Date dateCreated;
	//更新时间
	private Date dateUpdated;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Date getDateCreated() {
		return dateCreated;
	}
	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}
	public Date getDateUpdated() {
		return dateUpdated;
	}
	public void setDateUpdated(Date dateUpdated) {
		this.dateUpdated = dateUpdated;
	}
	
	/**
	 * @功能 根据栏目PO对象获得栏目DTO对象
	 */
	public static ColumnDto getDtoByPo(Column col){
		ColumnDto colDto = new ColumnDto();
		
		colDto.setId(col.getId());
		colDto.setTitle(col.getTitle());
		colDto.setDescription(col.getDescription());
		colDto.setDateCreated(col.getDateCreated());
		colDto.setDateUpdated(col.getDateUpdated());
		
		return colDto;
	}
	
	/**
	 * @功能 根据栏目DTO对象获得栏目PO对象
	 */
	public static Column getPoByDto(ColumnDto colDto){
		Column col = new Column();
		
		col.setTitle(colDto.getTitle());
		col.setDescription(colDto.getDescription());
		col.setDateCreated(colDto.getDateCreated());
		col.setDateUpdated(colDto.getDateUpdated());
		
		return col;
	}
	
	
}
